home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Genie / Projects / Pedestal / Source / Sources / Streams / PedBuffer.cc next >
Encoding:
C/C++ Source or Header  |  2000-06-24  |  539 b   |  52 lines

  1. /*    ============
  2.  *    PedBuffer.cc
  3.  *    ============
  4.  */
  5.  
  6. #include <string.h>
  7.  
  8. #include "PedBuffer.hh"
  9.  
  10.  
  11. PedBuffer::PedBuffer(long inSize)
  12. : mSize(inSize)
  13. {
  14.     mPtr = new char [inSize];
  15. }
  16.  
  17. PedBuffer::PedBuffer(long inSize, char *inData)
  18. : mSize(inSize)
  19. {
  20.     mPtr = new char [inSize];
  21.     memcpy(mPtr, inData, inSize);
  22. }
  23.  
  24. PedBuffer::~PedBuffer()
  25. {
  26.     delete mPtr;
  27. }
  28.  
  29. long
  30. PedBuffer::Length()
  31. {
  32.     return mLen;
  33. }
  34.  
  35. long
  36. PedBuffer::Size()
  37. {
  38.     return mSize;
  39. }
  40.  
  41. char *
  42. PedBuffer::Ptr()
  43. {
  44.     return mPtr;
  45. }
  46.  
  47. void
  48. PedBuffer::SetLength(long inLen)
  49. {
  50.     mLen = inLen;
  51. }
  52.